<!DOCTYPE html>
<html lang="zh-CN">
<head>
    {% load static %}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}{% endblock %} - f22016420刘逸梵-图书馆系统</title>
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
</head>
<body>
    <div class="container">
        <!-- 头部标题 -->
        <div class="header">
            <h1>小刘的图书馆</h1>
        </div>

        <!-- 导航栏：固定三个入口 -->
        <div class="nav">
            {% if user.is_authenticated %}
                <a href="{% url 'my-borrowed' %}" class="ml-2">我的借阅</a>
            {% endif %}
            <a href="{% url 'index' %}">首页</a>
            <a href="{% url 'books' %}">所有书籍</a>
            <a href="{% url 'authors' %}">所有作者</a>

            {% if user.is_authenticated %}
                <span class="ml-3">欢迎, {{ user.username }}!</span>
                <a href="{% url 'password_change' %}" class="btn btn-primary">修改密码</a>
                <a href="{% url 'user-logout' %}" class="ml-2 btn btn-secondary">退出</a>
            {% else %}
                <a href="{% url 'user-login' %}" class="ml-2 btn btn-primary">登录</a>
                <a href="{% url 'user-register' %}" class="ml-2 btn btn-secondary">注册</a>
            {% endif %}
        </div>

        <!-- 内容区 -->
        <div class="content">
            {% block content %}{% endblock %}
        </div>

        <!-- 页脚 -->
        <div class="footer">
            <p>&copy; 2025 小刘的本地图书馆</p>
        </div>
    </div>
</body>
</html>